package cz.cvut.manatee.client;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.MenuBar;

public class Menu extends Composite {
	
	Menu() {
		Command cmd = new Command() {
			public void execute() {
				Window.alert("You selected a menu item!");
			}
		};
		
		// Make some sub-menus that we will cascade from the top menu.
		MenuBar fooMenu = new MenuBar(true);
		fooMenu.addItem("the the the the", cmd);
		fooMenu.addItem("foo", cmd);
		fooMenu.addItem("menu", cmd);
		fooMenu.addItem("the", cmd);
		fooMenu.addItem("foo", cmd);
		fooMenu.addItem("menu", cmd);
		MenuBar barMenu = new MenuBar(true);
		barMenu.addItem("the the the the", cmd);
		barMenu.addItem("bar", cmd);
		barMenu.addItem("menu", cmd);
		barMenu.addItem("the", cmd);
		barMenu.addItem("bar", cmd);
		barMenu.addItem("menu", cmd);
		MenuBar bazMenu = new MenuBar(true);
		bazMenu.addItem("the the", cmd);
		bazMenu.addItem("baz", cmd);
		bazMenu.addItem("menu", cmd);
		
		// Make a new menu bar, adding a few cascading menus to it.
		MenuBar mainmenu = new MenuBar();
		mainmenu.setAnimationEnabled(true);
		mainmenu.setWidth("100%");
		
		mainmenu.addItem("Moje data", fooMenu);
		mainmenu.addItem("Nastavení aplikace", barMenu);
		mainmenu.addItem("Odhlásit se", bazMenu);
		
		this.initWidget(mainmenu);
	}

}
